home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.metal;
-
- import com.sun.java.swing.Icon;
- import com.sun.java.swing.JLabel;
- import com.sun.java.swing.JList;
- import com.sun.java.swing.plaf.basic.BasicListCellRenderer;
- import java.awt.Component;
- import java.io.File;
-
- class MetalFileChooserUI$DirectoryComboBoxRenderer extends BasicListCellRenderer {
- // $FF: synthetic field
- MetalFileChooserUI this$0;
-
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- File directory = (File)value;
- if (directory == null) {
- ((JLabel)this).setText("");
- return this;
- } else {
- String fileName = this.this$0.getFileChooser().getName(directory);
- ((JLabel)this).setText(fileName);
- Icon icon = this.this$0.getFileChooser().getIcon(directory);
- ((JLabel)this).setIcon(icon);
- return this;
- }
- }
-
- // $FF: synthetic method
- MetalFileChooserUI$DirectoryComboBoxRenderer(MetalFileChooserUI this$0) {
- this.this$0 = this$0;
- }
- }
-